package ecom.pojos;

import java.util.Vector;

public class Product implements java.io.Serializable {

	private static final long serialVersionUID = -3858642282014536731L;
	private String name;
	private String reference;
	private String description;
	private double stock;
	private String marque;
	private String category;
	private double euroPrice;
	private Vector<TechQuestion> techQuestions;
	private Vector<CustomerOpinion> customerOpinions;
	private int quantity;

	public Product(String name, String reference, String description,
			double stock, String marque, String category, double euroPrice,
			Vector<TechQuestion> techQuestions,
			Vector<CustomerOpinion> customerOpinions) {
		super();
		this.name = name;
		this.reference = reference;
		this.description = description;
		this.stock = stock;
		this.marque = marque;
		this.category = category;
		this.euroPrice = euroPrice;
		this.techQuestions = techQuestions;
		this.customerOpinions = customerOpinions;
		this.quantity = 0;
	}

	public String getName() {
		return name;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public int getQuantity() {
		return this.quantity;
	}

	public String getReference() {
		return reference;
	}

	public String getDescription() {
		return description;
	}

	public double getStock() {
		return stock;
	}

	public String getMarque() {
		return marque;
	}

	public String getCategory() {
		return category;
	}

	public double getEuroPrice() {
		return euroPrice;
	}

	public int getNbQuestions() {
		return techQuestions.size();
	}

	public int getNbAvis() {
		return customerOpinions.size();
	}

	public CustomerOpinion getAvis(int i) {
		return customerOpinions.elementAt(i);
	}

	public TechQuestion getQuestionTechnique(int i) {
		return techQuestions.elementAt(i);
	}

	public String getLargePicLink() {
		return reference + ".jpg";
	}

	public String getSmallPicLink() {
		return reference + "_small.jpg";
	}
}
